const { defineConfig } = require("webpack-common");
const TinyfyPlugin = require("webpack-plugin-tinyfy");
const NODE_ENV = process.env.NODE_ENV;

module.exports = defineConfig({
  devServer: {
    open: true,
    port: 4000,
    proxy: [
      {
        context: ["/oao"],
        target: `https://${NODE_ENV}-mobile-api.bankneo.co.id`,
        changeOrigin: true,
        secure: false,
        pathRewrite: {
          "^/oao": "",
        },
      },
    ],
  },
  plugins: [new TinyfyPlugin()],
});
